package com.unlcn.erp.hyc.interfaces.backend.service;

import com.unlcn.erp.hyc.interfaces.backend.bo.ImportHistoryDB;
import com.unlcn.erp.hyc.interfaces.base.mapper.SmimporthistoryMapper;
import com.unlcn.erp.hyc.interfaces.base.model.Smimporthistory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 掉用慧运车URL的到的日志
 * Created by zhiche024 on 2017/9/2.
 */
@Service
public class CallHYCUrlReceiveLogServiceImpl implements CallHYCUrlReceiveLogService{

    @Autowired
    private SmimporthistoryMapper smimporthistoryMapper;
    /**
     * 保存慧运车返回的信息
     */
    @Override
    public void saveCallHYCUrlReceiveLog(ImportHistoryDB db) {

        Smimporthistory history = new Smimporthistory();
        BeanUtils.copyProperties(db,history);
        history.setDtcreate(new Date());
        history.setResultCount((short)0);
        history.setIsupdatehistory((short)0);
        smimporthistoryMapper.insertSmimporthistory(history);

    }
}
